package com.ironman.compute.generator;


import cn.hutool.core.util.RandomUtil;
import lombok.RequiredArgsConstructor;
import org.noear.snack.ONode;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class HeadingComputeDataGenerator extends ComputeDataGenerator {

    @Override
    public String topicType() {
        return "heading";
    }

    @Override
    public ONode generate() {
        return ONode.newObject()
                .set("dueNorth", true)
                .set("heading", RandomUtil.randomInt(-180, 180))
                .set("leeway", RandomUtil.randomInt(-180, 180));
    }

}
